package com.cinema.data;

import java.io.Serializable;
import java.util.Date;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import com.google.appengine.api.datastore.Key;

@PersistenceCapable
public class FilmInfo implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key ID;
	
	@Persistent(valueStrategy = IdGeneratorStrategy.SEQUENCE)
	private long fid;
	
	@Persistent
	private String fname;
	
	@Persistent
	private String trailer;
	
	@Persistent
	private int rating;
	
	@Persistent
	private String shortInfo;
	
	@Persistent
	private String description;
	
	@Persistent
	private Date fromday;
	
	@Persistent
	private Date today;
	
	@Persistent
	private String imgLink;
	
	@Persistent(serialized = "true")
	private Schedule schedule;
	
	public FilmInfo(String fname, String trailer, int rating,
			String description, Date fromday,
			Date today, String shortInfo, String imgLink, Schedule schedule){
		this.fname = fname;
		this.trailer = trailer;
		this.rating = rating;
		this.description = description;
		this.fromday = fromday;
		this.today = today;
		this.shortInfo = shortInfo;
		this.setImgLink(imgLink);
		this.setSchedule(schedule);
	}
	
	public Key getID() {
		return ID;
	}

	public void setID(Key iD) {
		ID = iD;
	}

	public Long getFid() {
		return fid;
	}

	public void setFid(Long fid) {
		this.fid = fid;
	}

	public String getFname() {
		return fname;
	}

	public void setFname(String fname) {
		this.fname = fname;
	}

	public String getTrailer() {
		return trailer;
	}

	public void setTrailer(String trailer) {
		this.trailer = trailer;
	}

	public int getRating() {
		return rating;
	}

	public void setRating(int rating) {
		this.rating = rating;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Date getFromday() {
		return fromday;
	}

	public void setFromday(Date fromday) {
		this.fromday = fromday;
	}

	public Date getToday() {
		return today;
	}

	public void setToday(Date today) {
		this.today = today;
	}

	public Schedule getSchedule() {
		return schedule;
	}
	public void setSchedule(Schedule schedule) {
		this.schedule = schedule;
	}
	public String getShortInfo() {
		return shortInfo;
	}
	public void setShortInfo(String shortInfo) {
		this.shortInfo = shortInfo;
	}
	public String getImgLink() {
		return imgLink;
	}
	public void setImgLink(String imgLink) {
		this.imgLink = imgLink;
	}
}
